package com.flmz.system.controller.user;

import com.flmz.common.core.controller.BaseController;
import com.flmz.common.core.domain.R;
import com.flmz.common.core.domain.TableDataInfo;
import com.flmz.system.domain.user.dto.UserDTO;
import com.flmz.system.domain.user.dto.UserQueryDTO;
import com.flmz.system.service.user.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController {

	@Autowired
	private IUserService userService;

	@GetMapping("/list")
	public TableDataInfo list(UserQueryDTO userQueryDTO) {
		return getTableDataInfo(userService.list(userQueryDTO));
	}

	@PutMapping("/updateStatus")
	public R<Void> updateStatus(@RequestBody UserDTO userDTO) {
		return toR(userService.updateStatus(userDTO));
	}
}
